package com.rg.service;
//提供获取商品列表、首页推荐商品、菜单对应商品和通过商品ID查询商品的服务。
import com.rg.dao.Goodsdao;
import com.rg.model.GoodsModel;
import java.util.List;

public class GoodsService{
    private Goodsdao goodsdao=new Goodsdao();
    //首页轮播图获取
    public List<GoodsModel> selectScrollGoods(){
        List<GoodsModel> goodsList=null;
        goodsList=goodsdao.selectRecommandGoods();
        return goodsList;
    }
    //首页商品推荐参数
    public List<GoodsModel> selectIndexRecommendGoods(){
        List<GoodsModel> goodsList=null;
        goodsList=goodsdao.selectIndexRecommend();
        return goodsList;
    }
    //查询菜单对应的商品
    public List<GoodsModel> selectMenuGoodsByType(Integer Typeid){
        List<GoodsModel> MenugoodsList=null;
        MenugoodsList=goodsdao.selectMenuGoodsByType(Typeid);
        return MenugoodsList;
    }
    //根据商品ID查询商品
    public GoodsModel selectOneGoodsBygoodsId(Integer goodsId){
        GoodsModel goods=null;
        goods=goodsdao.selectGoodsBygoodsId(goodsId);
        return goods;
    }

}
